﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ColumnMetadata.cs" company="CodePlex">
//   Copyright © CodePlex 2012
// </copyright>
// <summary>
//   Defines the ColumnMetadata type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace DataFrameworkGenerator
{
    using System;

    /// <summary>
    /// Class to contain the metadata about a column extracted from the target database.
    /// </summary>
    public class ColumnMetadata
    {
        /// <summary>
        /// Gets or sets the type of the data.
        /// </summary>
        /// <value>The type of the data.</value>
        public Type DataType { get; set; }

        /// <summary>
        /// Gets or sets the provider data type.
        /// </summary>
        /// <value>The provider data type.</value>
        public int ProviderDataType { get; set; }

        /// <summary>
        /// Gets or sets the name of the column.
        /// </summary>
        /// <value>The name of the column.</value>
        public string ColumnName { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether the field is nullable.
        /// </summary>
        /// <value><c>true</c> if [nullable field]; otherwise, <c>false</c>.</value>
        public bool NullableField { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this field is a key field.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this field is a key field; otherwise, <c>false</c>.
        /// </value>
        public bool IsKeyField { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this field is an auto increment field.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this field is an auto increment field; otherwise, <c>false</c>.
        /// </value>
        public bool IsAutoIncrementField { get; set; }

        /// <summary>
        /// Gets or sets the column ordinal.
        /// </summary>
        /// <value>The column ordinal.</value>
        public int ColumnOrdinal { get; set; }

        /// <summary>
        /// Gets or sets the size of the column.
        /// </summary>
        /// <value>The size of the column.</value>
        public int ColumnSize { get; set; }

        /// <summary>
        /// Gets or sets the numeric precision.
        /// </summary>
        /// <value>The numeric precision.</value>
        public short NumericPrecision { get; set; }

        /// <summary>
        /// Gets or sets the numeric scale.
        /// </summary>
        /// <value>The numeric scale.</value>
        public short NumericScale { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is long.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is long; otherwise, <c>false</c>.
        /// </value>
        public bool IsLong { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is read only.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is read only; otherwise, <c>false</c>.
        /// </value>
        public bool IsReadOnly { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is row version.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is row version; otherwise, <c>false</c>.
        /// </value>
        public bool IsRowVersion { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether this instance is unique.
        /// </summary>
        /// <value>
        ///     <c>true</c> if this instance is unique; otherwise, <c>false</c>.
        /// </value>
        public bool IsUnique { get; set; }

        /// <summary>
        /// Gets or sets the name of the base schema.
        /// </summary>
        /// <value>The name of the base schema.</value>
        public object BaseSchemaName { get; set; } // Nullable<>

        /// <summary>
        /// Gets or sets the name of the base catalog.
        /// </summary>
        /// <value>The name of the base catalog.</value>
        public string BaseCatalogName { get; set; }

        /// <summary>
        /// Gets or sets the name of the base table.
        /// </summary>
        /// <value>The name of the base table.</value>
        public string BaseTableName { get; set; }

        /// <summary>
        /// Gets or sets the name of the base column.
        /// </summary>
        /// <value>The name of the base column.</value>
        public string BaseColumnName { get; set; }
    }
}
